const COS = require('cos-nodejs-sdk-v5');
require('dotenv').config();

const cosConfig = {
  SecretId: process.env.COS_SECRET_ID,
  SecretKey: process.env.COS_SECRET_KEY,
  Region: process.env.COS_REGION,
  Bucket: process.env.COS_BUCKET,
  RootDirectory: process.env.COS_ROOT_DIRECTORY || ''
};

// 初始化COS实例
const cos = new COS({
  SecretId: cosConfig.SecretId,
  SecretKey: cosConfig.SecretKey
});

module.exports = { cos, cosConfig }; 